package pl.mdziedzic.unittest;
import static org.junit.Assert.fail;

import java.util.concurrent.TimeUnit;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import pl.mdziedzic.unittest.Page;
import pl.mdziedzic.unittest.LoginPage;
import pl.mdziedzic.unittest.HomePage;
import pl.mdziedzic.unittest.seleniumBase;;

public class testPage {

	private static WebDriver driver;
	
	@BeforeClass
	public static void setUp() throws Exception {
		driver = new FirefoxDriver();		
		//driver = new HtmlUnitDriver();
		driver.manage().deleteAllCookies();
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
		//driver.get("http://demo.bananascrum.com/login");
		
		
	}
	@AfterClass
	public static void tearDown() throws Exception {
		driver.quit();	
	}
		
	
	
	
	@Test
	public void checkLoginPage(){
		//given
		LoginPage stronaLogowania = new LoginPage(driver);
		stronaLogowania.open();
		
		
		//when
		HomePage stronaDomowa =stronaLogowania.login("admin", "password");
				
		//then
		stronaDomowa.assertTextPresent("Banana Scrum Demo");
	}

}
